package com.lcj.ssm.serviceImpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.lcj.ssm.mapper.ManagerMapper;
import com.lcj.ssm.po.Manager;
import com.lcj.ssm.service.ManagerService;
import com.lcj.ssm.po.ManagerVO;
import com.lcj.ssm.po.PageMessage;

public class ManagerServiceImpl implements ManagerService{

	@Autowired
	private ManagerMapper managerMapper;

	public int insertManager(Manager manager) throws Exception {
		return managerMapper.insert(manager);
	}

	public int deleteManager(int id) throws Exception {
		return managerMapper.deleteByPrimaryKey(id);
	}

	public List<Manager> selectManagerList(ManagerVO managervo) throws Exception {
		return managerMapper.selectManagerList(managervo);
	}

	public Manager selectManager(Manager manager) throws Exception {
		if(manager!=null){
			return managerMapper.selectManager(manager);
		}else{
			return null;
		}
	}

	public int updateManager(Manager manager) throws Exception {
		return managerMapper.updateByPrimaryKey(manager);
	}

	public int getTotalCount() {
		return managerMapper.selectTotalCount();
	}

	public Manager selectManagerById(Integer id) throws Exception {
		if(id!=null && id>0){
			return managerMapper.selectByPrimaryKey(id);
		}else{
			return null;
		}
	}

}
